<template>
  <div>
    <el-button @click="pickerImage">选择图片</el-button>
  </div>
</template>

<script lang="ts" setup>
/**
 * 通用图片选取
 */
import { Cell } from '@antv/x6'
import { ImagePicker } from '../../../components/image-picker'

const props = defineProps<{
  cell: Cell
}>()

const _cell = toRaw(props.cell)
// region TODO 提交
function pickerImage () {
  ImagePicker.picker().then(function (e) {
    if (e !== null) {
      props.cell.attr('image/href', e)
    }
  })
}
// endregion

</script>

<style lang="scss" scoped>
</style>
